package com.jt.provider.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class ProviderController {

    @Value("${server.port:8080}")
    private String server;

    //访问方式：
    //1)浏览器中直接输入http://localhost:8081/provider/echo/tedu
    //2)在sca-consumer服务中对这个服务进行访问
    @GetMapping("/provider/echo/{msg}")
    public String doRestEcho1(@PathVariable String msg) throws InterruptedException {
        //Thread.sleep(5000);
        return server+" say hello "+msg;
    }
}
